package cn.wen.yinxiu.works.service;

import cn.wen.yinxiu.common.toolkit.PageUtils;
import cn.wen.yinxiu.works.entity.UsersCollectRelationEntity;
import cn.wen.yinxiu.works.recommend.UserTopic;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @ClassName: UsersCollectRelationService
 * @Author 小飞
 * @Email coderwen22@163.com
 * @Date 2023-05-21 22:19:26
 * @Description:
 */
public interface UsersCollectRelationService extends IService<UsersCollectRelationEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 获取用户收藏的数量
     * @param userId
     * @return
     */
    Long queryUserCollectWorksCount(Long userId);

    /**
     * 获取用户收藏的话题数量
     * @param userId
     * @param pastDate
     * @return
     */
    List<UserTopic> queryUserCollectTopicByDate(Long userId, String pastDate);

    /**
     * 用户收藏作品
     * @param worksId
     * @param userId
     * @return
     */
    boolean worksCollectById(Long worksId, Long userId);

    /**
     * 取消用户收藏作品
     * @param worksId
     * @param userId
     * @return
     */
    boolean worksCancelCollectById(Long worksId, Long userId);

}

